<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>axiethernet: xaxiethernet_example_extvlan.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.gif"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">axiethernet
   </div>
   <div id="projectbrief">Xilinx SDK Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xaxiethernet__example__extvlan_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">xaxiethernet_example_extvlan.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>Implements examples that utilize the Axi Ethernet's interrupt driven SGDMA packet transfer mode to send and receive frames. </p>
<p>This example demonstrates:</p>
<ul>
<li>How to setup VLAN strip/translate/tag in TX and RX direction</li>
<li>How the VLAN tags are handled</li>
<li>What is the expected VLAN tag(s) after VLAN functions are invoked</li>
</ul>
<p>Functional guide to example:</p>
<ul>
<li>AxiEthernetSgDmaIntrExtVlanExample demonstrates the extended VLAN capability. The HW must be setup for extended VLAN for this example to execute.</li>
</ul>
<pre>
MODIFICATION HISTORY:</pre><pre>Ver   Who  Date     Changes
<hr/>

1.00a asa  4/30/10  First release based on the ll temac driver
1.01a asa  12/10/10 Changes made to enable the AXIDMA Tx/Rx ring interrupts
                          before allocation of Tx/Rx BDs.
3.00a asa  6/25/12  Modifed XAxiDma_BdSetLength API call to support new
                          AXI DMA driver version 7.00a.
3.00a bss  10/22/12 Added support for Fast Interrupt Handlers.
3.01a srt  02/14/13 Added support for Zynq (CR 681136)
5.4   ms   01/23/17 Modified xil_printf statement in main function to
                    ensure that "Successfully ran" and "Failed" strings are
                    available in all examples. This is a fix for CR-965028.</pre><pre></pre> </div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ac09b8617f3bb5e65bea8863449c90a9f"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxiethernet__example__extvlan_8c.html#ac09b8617f3bb5e65bea8863449c90a9f">AxiEthernetExtVlanExample</a> (INTC *IntcInstancePtr, <a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *AxiEthernetInstancePtr, XAxiDma *DmaInstancePtr, u16 AxiEthernetDeviceId, u16 AxiDmaDeviceId, u16 AxiEthernetIntrId, u16 DmaRxIntrId, u16 DmaTxIntrId)</td></tr>
<tr class="memdesc:ac09b8617f3bb5e65bea8863449c90a9f"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function demonstrates the usage usage of the Axi Ethernet by sending and receiving frames in interrupt driven SGDMA mode.  <a href="#ac09b8617f3bb5e65bea8863449c90a9f">More...</a><br /></td></tr>
<tr class="separator:ac09b8617f3bb5e65bea8863449c90a9f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab6233034e8a9da2bafe28ffd757da9d8"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxiethernet__example__extvlan_8c.html#ab6233034e8a9da2bafe28ffd757da9d8">AxiEthernetSgDmaIntrExtVlanExample</a> (<a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *AxiEthernetInstancePtr, XAxiDma *DmaInstancePtr)</td></tr>
<tr class="memdesc:ab6233034e8a9da2bafe28ffd757da9d8"><td class="mdescLeft">&#160;</td><td class="mdescRight">This example sends and receives a single packet in loopback mode with extended VLAN support.  <a href="#ab6233034e8a9da2bafe28ffd757da9d8">More...</a><br /></td></tr>
<tr class="separator:ab6233034e8a9da2bafe28ffd757da9d8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xaxiethernet__example__extvlan_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
<tr class="memdesc:a840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is the main function for the Axi Ethernet example.  <a href="#a840291bc02cba5474a4cb46a9b9566fe">More...</a><br /></td></tr>
<tr class="separator:a840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="ac09b8617f3bb5e65bea8863449c90a9f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac09b8617f3bb5e65bea8863449c90a9f">&#9670;&nbsp;</a></span>AxiEthernetExtVlanExample()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int AxiEthernetExtVlanExample </td>
          <td>(</td>
          <td class="paramtype">INTC *&#160;</td>
          <td class="paramname"><em>IntcInstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *&#160;</td>
          <td class="paramname"><em>AxiEthernetInstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">XAxiDma *&#160;</td>
          <td class="paramname"><em>DmaInstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>AxiEthernetDeviceId</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>AxiDmaDeviceId</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>AxiEthernetIntrId</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>DmaRxIntrId</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>DmaTxIntrId</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function demonstrates the usage usage of the Axi Ethernet by sending and receiving frames in interrupt driven SGDMA mode. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">IntcInstancePtr</td><td>is a pointer to the instance of the Intc component. </td></tr>
    <tr><td class="paramname">AxiEthernetInstancePtr</td><td>is a pointer to the instance of the AxiEthernet component. </td></tr>
    <tr><td class="paramname">DmaInstancePtr</td><td>is a pointer to the instance of the AXIDMA component. </td></tr>
    <tr><td class="paramname">AxiEthernetDeviceId</td><td>is Device ID of the Axi Ethernet Device , typically XPAR_&lt;AXIETHERNET_instance&gt;_DEVICE_ID value from xparameters.h. </td></tr>
    <tr><td class="paramname">AxiDmaDeviceId</td><td>is Device ID of the Axi DMAA Device , typically XPAR_&lt;AXIDMA_instance&gt;_DEVICE_ID value from xparameters.h. </td></tr>
    <tr><td class="paramname">AxiEthernetIntrId</td><td>is the Interrupt ID and is typically XPAR_&lt;INTC_instance&gt;_&lt;AXIETHERNET_instance&gt;_VEC_ID value from xparameters.h. </td></tr>
    <tr><td class="paramname">DmaRxIntrId</td><td>is the interrupt id for DMA Rx and is typically taken from XPAR_&lt;AXIETHERNET_instance&gt;_CONNECTED_DMARX_INTR </td></tr>
    <tr><td class="paramname">DmaTxIntrId</td><td>is the interrupt id for DMA Tx and is typically taken from XPAR_&lt;AXIETHERNET_instance&gt;_CONNECTED_DMATX_INTR</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>-XST_SUCCESS to indicate success. -XST_FAILURE to indicate failure.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>AxiDma hardware must be initialized before initializing AxiEthernet. Since AxiDma reset line is connected to the AxiEthernet reset line, a reset of AxiDma hardware during its initialization would reset AxiEthernet. </dd></dl>

<p class="reference">Referenced by <a class="el" href="xaxiethernet__example__extvlan_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main()</a>.</p>

</div>
</div>
<a id="ab6233034e8a9da2bafe28ffd757da9d8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab6233034e8a9da2bafe28ffd757da9d8">&#9670;&nbsp;</a></span>AxiEthernetSgDmaIntrExtVlanExample()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int AxiEthernetSgDmaIntrExtVlanExample </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_axi_ethernet.html">XAxiEthernet</a> *&#160;</td>
          <td class="paramname"><em>AxiEthernetInstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">XAxiDma *&#160;</td>
          <td class="paramname"><em>DmaInstancePtr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This example sends and receives a single packet in loopback mode with extended VLAN support. </p>
<p>The transmit frame will have VLAN field populated.</p>
<p>On receive, HW should pass the VLAN field to receive BDs.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">AxiEthernetInstancePtr</td><td>is a pointer to the instance of the AxiEthernet component. </td></tr>
    <tr><td class="paramname">DmaInstancePtr</td><td>is a pointer to the instance of the Dma component.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>-XST_SUCCESS to indicate success. -XST_FAILURE to indicate failure.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>Summary of VLAN tags handling in this example</dd></dl>
<p>Frame setup with Tpid1+Cfi1+TxPid =&gt; 0x88A83111 Frame translated to TxTransVid =&gt; 0x88A83222 Frame tagged to Tpid2+Cfi2+TxTagVid =&gt; 0x9100C333 + 0x88A83222 Frame sent and loopbacked.</p>
<p>Frame stripped with RxStrpVid(0x333) =&gt; 0x88A83222 Frame translated (key:RxVid:0x222) RxTransVid =&gt; 0x88A83444 </p>

</div>
</div>
<a id="a840291bc02cba5474a4cb46a9b9566fe"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a840291bc02cba5474a4cb46a9b9566fe">&#9670;&nbsp;</a></span>main()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int main </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is the main function for the Axi Ethernet example. </p>
<p>This function is not included if the example is generated from the TestAppGen test tool.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">None.</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>- XST_SUCCESS to indicate success.<ul>
<li>XST_FAILURE to indicate failure</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="xaxiethernet__example__extvlan_8c.html#ac09b8617f3bb5e65bea8863449c90a9f">AxiEthernetExtVlanExample()</a>, and <a class="el" href="xaxiethernet__example_8h.html#ad700d3b9e292277d5437ecc4dc304dc3">AxiEthernetUtilErrorTrap()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Copyright &copy; 2015 Xilinx Inc. All rights reserved.</li>
  </ul>
</div>
</body>
</html>
